//
//  YYEIntrolSecondCell.m
//  YuYingEDU
//
//  Created by 胡波 on 2018/1/3.
//  Copyright © 2018年 胡波. All rights reserved.
//

#import "YYEIntrolSecondCell.h"

@interface YYEIntrolSecondCell ()

@property (nonatomic,strong) UIImageView *backIV;
@property (nonatomic,strong) UILabel *nameLabel;

@end

@implementation YYEIntrolSecondCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.contentView.backgroundColor = GeneralBackColor;
        
        self.backIV = [[UIImageView alloc]init];
        self.backIV.image = [UIImage imageNamed:@"bottomBorder"];
        
        // UIEdgeInsetsMake(0, 0, 30, 0) 里面的值是保护区域
        self.backIV.image = [self.backIV.image resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 30, 0) resizingMode:(UIImageResizingModeStretch)];
        [self.contentView addSubview:self.backIV];

        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textColor = [UIColor blackColor];
        self.nameLabel.font = [UIFont systemFontOfSize:13];
        self.nameLabel.numberOfLines = 0;
        [self.backIV addSubview:self.nameLabel];
        
        self.nameLabel.text = @"    源于企业真实Java项目，设计大量Java零基础必学技巧，完整覆盖权限管理系统开发技术。";
        
    }
    return self;
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.backIV makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(UIEdgeInsetsMake(0.5, 8, 10, 8));
    }];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(UIEdgeInsetsMake(10, 10, 10, 10));
    }];
    
}

- (void)setModel:(YYECourseIntroModel *)model {
    _model = model;
    
    self.nameLabel.text = model.intro;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
